<div class="">
  <!--<nz-spin [nzTip]="'正在导入请等待...'" [nzSize]="'large'">-->

  <nz-collapseset>
    <nz-collapse [nzTitle]="'查询'" [nzActive]="true">
      <form nz-form [nzLayout]="'inline'">
        <div nz-row>

          <div nz-form-item nz-col [nzSpan]="4">
            <div nz-form-label nz-col [nzSm]="9" [nzXs]="6">
              <label>计划名称</label>
            </div>
            <div nz-form-control nz-col [nzSm]="12" [nzXs]="12">
              <nz-select style="width: 200px;" name="elevatorTypeId" nzAllowClear [nzPlaceHolder]="'请选择'"
                         [nzShowSearch]="true" [(ngModel)]="planValue" >
                <nz-option *ngFor="let option of options"  [nzLabel]="option" [nzValue]="option">
                </nz-option>
              </nz-select>
            </div>
          </div>
          <div nz-form-label nz-col [nzSpan]="3">
            <label>时间</label>
          </div>
          <div nz-form-control nz-col [nzSpan]="7">
            <nz-datepicker [nzSize]="'middle'"  [nzFormat]="'YYYY-MM-DD'" name="startDate" [(ngModel)]="startDate" [nzPlaceHolder]="'开始日期'"></nz-datepicker>
            至
            <nz-datepicker [nzSize]="'middle'"  [nzFormat]="'YYYY-MM-DD'" name="endDate" [(ngModel)]="endDate" [nzPlaceHolder]="'结束日期'"></nz-datepicker>
          </div>

          <button nz-button [nzSize]="'middle'" [nzType]="'primary'" (click)="queryData()" >查询</button>
        </div>


      </form>
    </nz-collapse>
  </nz-collapseset>
  <ul nz-menu [nzMode]="'horizontal'">
    <li nz-menu-item (click)="add(title, content, footer)">
      <i class="anticon anticon-plus"></i>添加
    </li>
    <!--<li nz-menu-item>
      <i class="anticon anticon-copy" (click)="update(title, content, footer)" ></i>修改
    </li>-->

    <li nz-menu-item (click)="delete()">
      <i class="anticon anticon-copy"></i>删除
    </li>


  </ul>
  <nz-table #nzTable [nzDataSource]="planData" nzSize="middle" [nzBordered]="true" [nzIsPagination]="false"
            (nzDataChange)="displayDataChange($event)">
    <thead nz-thead>
    <tr>
      <th nz-th [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)" >
        </label>
      </th>
      <th nz-th>
        <span>计划名称</span>
      </th>
      <th nz-th>
        <span>单位</span>
      </th>
      <th nz-th>
        <span>计划开始时间</span>
      </th>
      <th nz-th>
        <span>计划结束时间</span>
      </th>
      <th nz-th>
        <span>创建人</span>
      </th>
      <th nz-th>
        <span>创建时间</span>
      </th>
      <th nz-th>
        <span>检查内容清单</span>
      </th>
      <th nz-th>
        <span>添加实施对象</span>
      </th>
      <th nz-th>
        <span>查看详情</span>
      </th>

    </tr>
    </thead>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of planData">
      <td nz-td [nzCheckbox]="true">
        <label nz-checkbox  nz-checkbox [nzDisabled]="data.disabled" [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
        </label>
      </td>
      <td nz-td>{{data.planName}}</td>
      <td nz-td>{{data.company}}</td>
      <td nz-td>{{data.planStartTime | date:'yyyy-MM-dd'}}</td>
      <td nz-td>{{data.planEndTime | date:'yyyy-MM-dd'}}</td>
      <td nz-td>{{data.createBy}}</td>
      <td nz-td>{{data.createDate | date:'yyyy-MM-dd'}}</td>

      <td nz-td>
        <button nz-button [nzSize]="'small'" [nzType]="'primary'" (click)="importCheckItem(title, content, footer, data)" >添加检查项</button>
      </td>

      <td nz-td>
        <button nz-button [nzSize]="'small'" [nzType]="'primary'" (click)="addObject(title, content, footer, data)">添加</button>
      </td>
      <td nz-td>
        <button nz-button [nzSize]="'small'" [nzType]="'primary'" (click)="showPD(data)">查看</button>
      </td>

    </tr>
    </tbody>
  </nz-table>


  <nz-pagination [nzPageIndex]="spotCheckPlan.currentPage" nzShowTotal [nzTotal]="total" nzShowSizeChanger
                 (nzPageSizeChange)="nzPageSizeChange($event)" (nzPageIndexChange)="nzPageIndexChange($event)"
                 (nzPageIndexClickChange)="nzPageIndexClickChange($event)" [nzPageSize]="spotCheckPlan.pageSize"></nz-pagination>




  <!--添加界面-->
  <ng-template #title>
    <span>{{modelTitle}}</span>
  </ng-template>
  <ng-template #content>
    <spot-check-add *ngIf="modal==0" [inValue]="this" (outPut)="addOutPut($event)"></spot-check-add>
    <spot-check-item *ngIf="modal==1" [inValue]="this" (outPut)="addOutPut($event)"></spot-check-item>
    <spot-object-add *ngIf="modal==2" [inValue]="this" (outPut)="addOutPut($event)"></spot-object-add>
  </ng-template>
  <ng-template #footer>
    <div>
    </div>
  </ng-template>
  <!-- </nz-spin>-->
</div>
